package com.example.zdxk.util;

public class getElc {

     public static  int  getelc(float vol)
     {
       if(vol<=4.2&&vol>4.08)
          return (int)(90+10*(vol-4.08)/(4.2-4.08));
       else if(vol<=4.08&&vol>4.0)
           return (int)(80+10*(vol-4.0)/(4.08-4.0));
       else if(vol<=4.0&&vol>3.93)
           return (int)(70+10*(vol-3.93)/(4.0-3.93));
       else if(vol<=3.93&&vol>3.87)
           return (int)(60+10*(vol-3.87)/(3.93-3.87));
       else if(vol<=3.87&&vol>3.82)
           return (int)(50+10*(vol-3.82)/(3.87-3.82));
       else if(vol<=3.82&&vol>3.79)
           return (int)(40+10*(vol-3.79)/(3.82-3.79));
       else if(vol<=3.79&&vol>3.77)
           return (int)(30+10*(vol-3.77)/(3.79-3.77));
       else if(vol<=3.77&&vol>3.73)
           return (int)(20+10*(vol-3.73)/(3.77-3.73));
       else if(vol<=3.73&&vol>3.7)
           return (int)(15+10*(vol-3.7)/(3.73-3.7));
       else if(vol<=3.7&&vol>3.68)
           return (int)(10+10*(vol-3.68)/(3.7-3.68));
       else if(vol<=3.68&&vol>3.5)
           return (int) (5+10*(vol-3.5)/(3.68-3.5));
       else
           return (int)(10*(vol-2.5)/(3.5-2.5));

     }




}
